package com.yh.construct.decorator.sendMessage;

/**
 * @program: design-patterns
 * @description: ${description}
 * @author: yangh0597@163.com
 * @date: 2021-03-08 21:23
 * @problem:
 **/
public class Main {


    public static void main(String[] args) {
//        CommonMessageDegree commonMessageDegree = new CommonMessageDegree();
//        KLPAMessage klpaMessage = new KLPAMessage(commonMessageDegree);
//        klpaMessage.sendMsg();
//        EmailMessage emailMessage = new EmailMessage(new UrgencyMessageDegree());
//        emailMessage.sendMsg();


        CommonMessageDegree commonMessageDegree = new CommonMessageDegree();
        KLPAMessage klpaMessage = new KLPAMessage(commonMessageDegree);
        //  klpaMessage.sendMsg();
        EmailMessage emailMessage = new EmailMessage(new UrgencyMessageDegree());


        //   emailMessage.sendMsg();

        MessageDecorate messageDecorate = new StatisticsMessageDecorate(klpaMessage);
        messageDecorate = new UpdateTableMessageDecorate(messageDecorate);

        messageDecorate.sendMsg();


        System.out.println("end==>" + StatisticsMessageDecorate.AllCount);


    }
}
